package org.hashdb.client.console.completer;

import jline.console.completer.StringsCompleter;

import java.util.Collection;
import java.util.stream.Stream;

/**
 * Date: 2024/1/11 17:10
 *
 * @author huanyuMake-pecdle
 * @version 0.0.1
 */
public class IgnoreCaseStringsCompleter extends StringsCompleter {
    public IgnoreCaseStringsCompleter() {
    }

    public IgnoreCaseStringsCompleter(Collection<String> strings) {
        super(strings.stream().flatMap(s -> Stream.of(s.toLowerCase(), s.toUpperCase())).toList());
    }

    public IgnoreCaseStringsCompleter(String... strings) {
        super(Stream.of(strings).flatMap(s -> Stream.of(s.toLowerCase(), s.toUpperCase())).toList());
    }
}
